﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using PHMEE.MqttClient.MqttBusinessCommand;
using PHMEE.TDengineInfrastructure;
using StackExchange.Redis;
using Volo.Abp;
using Volo.Abp.Modularity;

namespace PHMEE.MqttClient
{
    [DependsOn(typeof(PHMEETDengineInfrastructureModule))]
    public class PHMEEMqttClientModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            var configuration = context.Services.GetConfiguration();
            bool isEnabled = configuration.GetValue<bool>("MqttClient:IsEnabled");

            if (isEnabled)
            {
                context.RegisterService();
            }

        }
    }
}
